typedef struct gpgga{
unsigned char header[7];
unsigned char rtc_msg[7];
unsigned char hh;
unsigned char mm;
unsigned char ss;
unsigned int ms;
unsigned char xhh;
unsigned char xmm;
unsigned char xss;
unsigned char latdd;
unsigned char latmm;
unsigned int latdmm;
unsigned char NS;
unsigned char londd;
unsigned char lonmm;
unsigned int londmm;
unsigned char EW;
unsigned char qual;
unsigned char SVs;
unsigned char hdop;
unsigned char dhdop;
int alt;
unsigned char dalt;
unsigned char alt_units;
int geoid;
unsigned char dgeoid;
unsigned char geoid_units;
unsigned int base;
unsigned char checksum;
} gpgga_struct;

typedef struct gprmc{
unsigned char header[7];
unsigned char rtc_msg[7];
unsigned char hh;
unsigned char mm;
unsigned char ss;
unsigned int ms;
unsigned char xhh;
unsigned char xmm;
unsigned char xss;
unsigned char stat;
unsigned char latdd;
unsigned char latmm;
unsigned int latdmm;
unsigned char NS;
unsigned char londd;
unsigned char lonmm;
unsigned int londmm;
unsigned char EW;
int speed;
unsigned char dspeed;
int course;
unsigned char dcourse;
unsigned char DD;
unsigned char MM;
unsigned char YY;
unsigned char mvar;
unsigned char dmvar;
unsigned char mvarEW;
unsigned char mode;
unsigned char checksum;
} gprmc_struct;

unsigned char gps_gets(char *str,unsigned char len, char delim);
void nmea_read(gpgga_struct *gpgga_msg, gprmc_struct *gprmc_msg, unsigned char mode);